#include "blogservice.h"
#include <QMutex>
#include <QMutexLocker>

#include "requesthandlerthread.h"
#include "requesthandlerthreadpool.h"

BlogService::BlogService()
:m_serviceName("Blog"), m_mutex(new QMutex())
{
}

BlogService::~BlogService()
{
    m_serviceName = "";
    delete m_mutex;
}

void BlogService::process(unsigned int session_id,
                        std::string request_id,
                        std::string request_type,
                        std::string request)
{
    RequestHandlerThread *handler_thread = new RequestHandlerThread(session_id,
                                                                    m_serviceName,
                                                                    request_id,
                                                                    request_type,
                                                                    request);

    RequestHandlerThreadPool::getInstance()->addHandlerThread(handler_thread);
    handler_thread->start();
}

void BlogService::run()
{
}

void BlogService::stop()
{
}
